package com.zxx.pattern.chainPattern.chain;

/**
 * 第一个责任处理节点
 *
 * @author zxx on 2021/1/25
 */
public class ConcreteHandler1 extends Handler {

    @Override
    public void handleMessage(int type) {
        if (type == 1 || type == 3) {
            System.out.println("ConcreteHandler1解决了问题！");
        } else {
            System.out.println("ConcreteHandler1解决不了问题....");
            if (nextHandler != null) {
                nextHandler.handleMessage(type);
            } else {
                System.out.println("没人能处理这个问题！");
            }
        }
    }
}
